/*
 * ========================================================================
 *
 *       Filename:  fcframe.h
 *
 *    Description:  This defines the basic window for the application.
 *
 *        Version:  1.0
 *        Created:  05/11/2010 10:37:46 AM
 *       Revision:  none
 *       Compiler:  g++
 *
 *         Author:  Alex Avance (aa), aravance@gmail.com
 *        Company:  independent
 *
 * ========================================================================
 *
 * Copyright (C) 2010 Alex Avance
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-
 * 1307, USA.
 *
 * ========================================================================
 */
#ifndef _FLASHCARDFRAME_H_
#define _FLASHCARDFRAME_H_

#include "wx/filedlg.h"
#include "wx/frame.h"
#include "wx/menu.h"
#include "testboard.h"
#include "studyboard.h"
#include "deck.h"

const size_t g_StudyMenuPos= 1;

/**************************************************************************
Class Name: FlashCardFrame
Description: 
**************************************************************************/
class FlashCardFrame: public wxFrame
{
public:
  // ====================  LIFECYCLE      ===============================
  FlashCardFrame ( const wxString &title= _("FlashCard"),
                   const wxPoint &pos= wxDefaultPosition,
                   const wxSize &size= wxDefaultSize );
  ~FlashCardFrame ();

  bool Save ();
  bool SaveAs ();
  bool Open ( const wxString &filename );
  virtual bool Show ( bool show= true );

  // ====================  EVENT HANDLERS ===============================

  void ConfirmQuit ( wxCloseEvent &event );

  void OnStudy ( wxCommandEvent &event );
  void OnTest ( wxCommandEvent &event );
  void OnReset ( wxCommandEvent &event );
  void OnSaveCard ( wxCommandEvent &event );
  void OnDelCard ( wxCommandEvent &event );
  void OnSave ( wxCommandEvent &event );
  void OnSaveAs ( wxCommandEvent &event );
  void OnOpen ( wxCommandEvent &event );
  void OnClose ( wxCommandEvent &event );
  void OnQuit ( wxCommandEvent &event );
  void OnHideList ( wxCommandEvent &event );
  void OnIgnoreCase ( wxCommandEvent &event );
  void OnIgnorePunct ( wxCommandEvent &event );
  void OnKeepRight ( wxCommandEvent &event );
  void OnRandomSide ( wxCommandEvent &event );
  void OnFrontSide ( wxCommandEvent &event );
  void OnBackSide ( wxCommandEvent &event );
  void OnAbout ( wxCommandEvent &event );
  void OnLicense ( wxCommandEvent &event );

  // ====================  DATA MEMBERS  ================================
protected:
  StudyDeck m_Deck;

  wxMenuBar *m_MenuBar;

  wxMenu *m_MenuFile;
  wxMenu *m_MenuTestSettings;
  wxMenu *m_MenuStudySettings;
  wxMenu *m_MenuHelp;

  wxMenuItem *m_ItemStudy;
  wxMenuItem *m_ItemTest;
  wxMenuItem *m_ItemReset;
  wxMenuItem *m_ItemSaveCard;
  wxMenuItem *m_ItemDelCard;
  wxMenuItem *m_ItemSave;
  wxMenuItem *m_ItemSaveAs;
  wxMenuItem *m_ItemOpen;
  wxMenuItem *m_ItemClose;
  wxMenuItem *m_ItemQuit;
  wxMenuItem *m_ItemRandomSide;
  wxMenuItem *m_ItemFrontSide;
  wxMenuItem *m_ItemBackSide;
  wxMenuItem *m_ItemIgnoreCase;
  wxMenuItem *m_ItemIgnorePunct;
  wxMenuItem *m_ItemKeepRight;
  wxMenuItem *m_ItemHideList;
  wxMenuItem *m_ItemAbout;
  wxMenuItem *m_ItemLicense;

  wxFileDialog *m_FileDialog;

  StudyBoardPanel *m_StudyBoard;
  TestBoardPanel *m_TestBoard;

  wxArrayString m_FileNames;

  DECLARE_EVENT_TABLE();
}; // ----- end of class FlashCardFrame -----

#endif // _FLASHCARDFRAME_H_

